import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import TypeNav from './components/TypeNav'
import './mock/mockServer'
import 'swiper/css/swiper.min.css'
import Pagination from './components/Pagination'
import {Message,Loading,MessageBox,Notification} from 'element-ui'
import * as api from '@/api'
import './utils/validate'
import VueLazyload from 'vue-lazyload'
import tang from '@/assets/images/tang.jpg'

//关闭Vue生产提示
Vue.config.productionTip = false
//全局注册TypeNav，因为很多组件用到了TypeNav
Vue.component(TypeNav.name,TypeNav)
//全局注册Pagination，因为很多组件用到了Pagination
Vue.component(Pagination.name,Pagination)
//图片懒加载
Vue.use(VueLazyload,{
	loading:tang
})

//将element-ui中常用的小交互组件都放在原型上
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
Vue.prototype.$api = api;

new Vue({
	el:'#app',
	beforeCreate() {
		Vue.prototype.$bus = this
	},
	render: h=>h(App),
	router,
	store
})